<#include "inc/layout.html"/>
<@layout title="后台管理系统">
<style>
    .icon-magnet:before {
        content: "YANGO";
    }
    .card-box,.form-control{border-radius:0px;}
    .red{color:red;}
    .green{color:green;}
    .layer_gotop{background: url(/s/images/layer_ico.png) no-repeat;width: 57px; height: 57px; overflow: hidden;position: fixed; right:10px; bottom:10px;display:none;
        z-index:1000;
    }
    .layer_gotop:hover{ background-position:-70px 0px;}
</style>
<div id="wrapper">
    <div class="topbar">
        <div class="topbar-left">
            <div class="text-center">
                <a href="#" class="logo open-left"><i class="icon-magnet icon-c-logo"></i><span>Yang<i
                        class="md md-album"></i></span></a>
            </div>
        </div>
        <div class="navbar navbar-default" role="navigation">
            <div class="container">
                <div>
                    <ul class="nav navbar-nav navbar-right pull-right">
                        <#--
                        <li class="dropdown hidden-xs">
                            <a href="#" data-target="#" class="dropdown-toggle waves-effect waves-light"
                               data-toggle="dropdown" aria-expanded="true">
                                <i class="icon-bell"></i> <span class="badge badge-xs badge-danger">3</span>
                            </a>
                            <ul class="dropdown-menu dropdown-menu-lg">
                                <li class="notifi-title"><span class="label label-default pull-right">New 3</span>Notification
                                </li>
                                <li class="list-group nicescroll notification-list">
                                    <a href="javascript:void(0);" class="list-group-item">
                                        <div class="media">
                                            <div class="pull-left p-r-10">
                                                <em class="fa fa-diamond fa-2x text-primary"></em>
                                            </div>
                                            <div class="media-body">
                                                <h5 class="media-heading">s</h5>
                                                <p class="m-0">
                                                    <small></small>
                                                </p>
                                            </div>
                                        </div>
                                    </a>
                                </li>
                                <li>
                                    <a href="javascript:void(0);" class="list-group-item text-right">
                                        <small class="font-600">查看所有信息</small>
                                    </a>
                                </li>
                            </ul>
                        </li>-->
                        <li class="hidden-xs">
                            <a href="#" id="btn-fullscreen" class="waves-effect waves-light" onclick="reSize();"><i
                                    class="icon-size-fullscreen"></i></a>
                        </li>
                        <li class="dropdown">
                            <a href="" class="dropdown-toggle profile" data-toggle="dropdown" aria-expanded="true"><img
                                    src="${(admin_login_user.aavator)!'/s/images/avatar.png'}" alt="user-img" class="img-circle"> ${admin_login_user.realname}</a>
                            <ul class="dropdown-menu">
                                <li><a href="javascript:void(0)"onclick="contentLoadPage('/sysUser/profile')"><i class="ti-user m-r-5"></i>个人信息</a></li>
                                <li><a href="javascript:logout()"><i class="ti-power-off m-r-5"></i>退出</a></li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>

    <div class="left side-menu">
        <div class="sidebar-inner slimscrollleft">
            <div id="sidebar-menu">
                <ul>
                    <li>
                        <a href="javascript:void(0);"onclick="contentLoadPage('/dashboard');"><i
                                class="ti-home"></i><span>首页</span></a>
                    </li>
                    <#if menuList??>
                    <#list menuList as tmenu>
                        <#if ''==(tmenu.parentid)!''>
                            <#if tmenu.levelno==1 && (''== (tmenu.url)!'') && tmenu.type==1>
                                <li class="has_sub">
                                    <a href="#" class="waves-effect"><i class="${tmenu.icon!'ti-menu-alt'}"></i>
                                        <span> ${tmenu.name} </span> </a>
                                    <ul class="list-unstyled">
                                        <#list menuList as cmenu>
                                            <#if cmenu.parentid?? && tmenu.id==cmenu.parentid && cmenu.levelno==2>
                                                <li class="active"><a href="javascript:void(0);"onclick="contentLoadPage('${cmenu.url}');">
                                                    <i class="${cmenu.icon!'ti-menu-alt'}"></i>${cmenu.name}</a>
                                                </li>
                                            </#if>
                                        </#list>
                                    </ul>
                                </li>
                                <#elseif tmenu.levelno==1 && tmenu.type==1>
                                    <li>
                                        <a href="javascript:void(0);"onclick="contentLoadPage('${tmenu.url}');" class="waves-effect"><i
                                                class="${tmenu.icon!'ti-menu-alt'}"></i><span>${tmenu.name}</span></a>
                                    </li>
                            </#if>
                        </#if>
                    </#list>
                    </#if>
                </ul>
                <div class="clearfix"></div>
            </div>
            <div class="clearfix"></div>
        </div>
    </div>
        <div class="content-page">
            <div class="content" style="padding:10px 0px 10px 10px;">
                <div class="container" id="mainContent" style="padding-left:0px;">
                </div>
            </div>
        </div>
</div>
<a href="javascript:;" class="layer_gotop"></a>
<#include "inc/lib.html"/>
<script src="/s/admin/js/jquery.core.js"></script>
<script src="/s/admin/js/jquery.app.js"></script>
<script type="text/javascript">
    var ajaxLoadPage=function(obj,url_,data_){
        var lay_loading= layer.load();
        $.ajax({
            url:url_,
            type: "POST",
            data: data_,
            dataType: "html",
            success: function(html_) {
                $(obj).empty().html(html_);
                layer.close(lay_loading);
            },error:function(e){
                layer.alert("加载异常!",{title:'系统提示',time:2000,icon:5,shadeClose:true})
                layer.close(lay_loading);
            }
        })
    }
    var resizefunc = [];
    function contentLoadPage(url,data){
        $('html, body').animate({scrollTop : 0},$(".layer_gotop").offset().top/7);
        ajaxLoadPage("#mainContent","/admin"+url,data);
    }
    $(function ($) {
        contentLoadPage("/dashboard");
        $('.counter').counterUp({
            delay: 100,
            time: 1200
        });
        $(".knob").knob();
    });
    function logout(){
        layer.confirm('确定退出系统？', {
            btn: ['直接退出','取消']
            ,shadeClose:true
        }, function(){
           window.location="/admin/logout";
        }, function(){
        });
    }
    $(function(){
        var conf = {};
        conf.gotop = $('.layer_gotop');
        conf.gotop.on('click',function(){
            $('html, body').animate({scrollTop : 0},$(this).offset().top/7);
        });
        conf.log = 0;
        $(window).on('scroll', function(){
            var stop = $(window).scrollTop();
            if(stop >= 60){
                if(!conf.log){
                    conf.log = 1;
                    conf.gotop.show();
                }
            } else {
                if(conf.log){
                    conf.log = 0;
                    conf.gotop.hide();
                }
            }
            stop = null;
        });
    }());
</script>
</@layout>